<template>
  <div>
     登录页面
       <img :src="img"  @click="getVeri">
  </div>
</template>

<script >
import { getVeriApi } from '@/api/login';
 export default {
  data(){
    return {
          img:"",//base64位字符串的图片
          uuid:""//随机字符串
    }
  },
  created(){
    this.getVeri()
  },
   methods:{
    async getVeri(){
         let res=await getVeriApi()
         console.log(res,"验证码")
         this.uuid=res.uuid//登录需要的uuid
         this.img="data:image/png;base64,"+res.img //base64位字符串的图形验证码图片
    }
   }
 }
</script>